package com.qiangqiang.dbpool;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created by q on 2018/3/28.
 */
public class MySqlDAO {
    public static Connection getConnection() throws ClassNotFoundException, SQLException {
        String driverName="com.mysql.jdbc.Driver";
        String url="jdbc:mysql://localhost:3306/student";
        String userName="root";
        String password="root";
        Class.forName(driverName);
        Connection con= DriverManager.getConnection(url,userName,password);
        return con;
    }

}
